package list.trst.Demo5;

public class AddableDemo {
    public static void main(String[] args) {
        useAddable(new Addable() {
            @Override
            public int add(int a, int b) {
                return a+b;
            }
        });

/*        Addable a1 =new Addable(){
            @Override
            public int add(int a, int b) {
                return 0;
            }
        };
        a1.add(10,20);*/

        useAddable(( a , b)-> a+b);
    }
    public static void useAddable(Addable a){
        int result=a.add(10,20);
        System.out.println(result);
    }
}
